import { S } from '../../s';
import { IPSImageItem } from './ipsimage-item';
import { PSRawItemImplBase } from './psraw-item-impl-base';
import { IPSSysImage } from '../../res/ipssys-image';

export class PSImageItemImpl extends PSRawItemImplBase implements IPSImageItem {
  get alternativeText(): string {
    return this.M.alternativeText;
  }

  get fitMode(): string {
    return this.M.fitMode;
  }

  protected pssysimage: IPSSysImage;
  getPSSysImage(): IPSSysImage | null {
    return (
      this.pssysimage ||
      (this.pssysimage = this.fillObjectModel(
        S._27b,
        this.M.getPSSysImage,
        S._2ad,
      ) as IPSSysImage)
    );
  }

  get placeCenter(): boolean {
    return this.M.placeCenter != null ? this.M.placeCenter : false;
  }
  get cls(): string {
    return 'PSImageItemImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._3c1 || cls == S._3af) return true;
    return super.instanceof(cls);
  }
}
